package wikiPhilia_two;

import java.util.ArrayList;

import processing.core.PApplet;


public class writerTest extends PApplet{
	TsvWriterModule twm = new TsvWriterModule(this);
	String personZero = "Buckminster_Fuller";
	String outputFileName = personZero + "_complete_stuff.tsv";
	public void setup() {
		twm = new TsvWriterModule(this);
		twm.init(outputFileName);
		twm.printLinks(personZero);
		twm.printBackLinks(personZero);
    	twm.printSuperCategories(personZero);
		WArticle pzArticle = new WArticle(this, personZero);
//		ArrayList<WCategory> pzCats = pzArticle.getCategories();
//		for (int i = 0; i < pzCats.size(); i++) {
//		System.out.println("Printing SubCategories / Pages for Supercategory n. " + (i+1) + " of " + pzCats.size() + "." );
//			twm.printSubCategoriesPages(pzCats.get(i).title);
//		}
		ArrayList<WArticle> pzLinks = pzArticle.getLinks();
		for (int i = 0; i < pzLinks.size(); i++) {
			System.out.println("Printing Links for Link n. " + (i+1) + " of " + pzLinks.size() + "." );
			twm.printLinks(pzLinks.get(i).title);
			twm.printBackLinks(pzLinks.get(i).title);
		}
		ArrayList<WArticle> pzBackLinks = pzArticle.getBackLinks();
		for (int i = 0; i < pzBackLinks.size(); i++) {
			System.out.println("Printing BackLinks for Link n. " + (i+1) + " of " + pzBackLinks.size() + "." );
			twm.printLinks(pzBackLinks.get(i).title);
			twm.printBackLinks(pzBackLinks.get(i).title);
		}
		twm.finish();
	}
}
